<?php

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package   App_Backend
 * @author    Cheng Wei <berlios.o@gmail.com>
 * @version   $$Id: BlockController.php 20 2010-12-18 09:35:07Z cheng.wei $$
 * @copyright Copyright (c) 2008 Evebit Inc. China (http://www.evebit.com)
 */

/**
 * Controller for block action
 * 
 * @package   App_Backend
 * @author    Cheng Wei <berlios.o@gmail.com>
 * @version   $$Id: BlockController.php 20 2010-12-18 09:35:07Z cheng.wei $$
 */
class Blocks_BlockController extends Evebit_Controller_Action_Public {
	
	/**
	 * render an block
	 */
	public function renderAction() {
		$options = $this->getRequest()->getParams();
		try {
			foreach ($options as $name => $val) {
				$this->view->$name = $val;
			}
			$template = $this->view->template;
			
			if ($this->view->scope) {
				$template = $this->view->scope . '/' . $template;
			}
			
			$this->render($template, null, true);
		} catch (Exception $e) {
			$this->getLog()->err($e);
			die('sdfsdf');
		}
	}

}

